package com.gitee.wsl.mathematics.matrix.ext



import com.gitee.wsl.mathematics.matrix.Matrix
import com.gitee.wsl.mathematics.matrix.MutableMatrix

val <T:Number,Q: Matrix<T, *, *>> Q.identity get() = toMutable().setIdentity()

fun  <T:Number,Q:MutableMatrix<T,*,*>> Q.setIdentity() = buildMatrix(this){ i, j->
    if( i == j ) one else zero
}

/*
fun  <T:Number,Q:MutableMatrix<T,*,*>> Q.copyIdentity() = copy{i,j->
    if( i == j ) one else zero
}

fun  <T:Number,Q: MutableMatrix2<T, *, *>> Q.copyIdentity() = copy{ i, j->
    if( i == j ) one else zero
}

fun  <T:Number,Q: MutableMatrix3<T, *, *>> Q.copyIdentity() = copy{ i, j->
    if( i == j ) one else zero
}

fun  <T:Number,Q: MutableMatrix4<T, *, *>> Q.copyIdentity() = copy{ i, j->
    if( i == j ) one else zero
}*/
